<template>
  <div>
    <el-date-picker  style="width: 100%" v-model="value5" class="dateTime" type="date" @change="timeChange" :value-format="format" :format="format" :placeholder="placeholder"/>
  </div>
</template>

<script>
  export default {
    name: 'templateTime',
    props: {
      format: {
        // 时间格式
        type: String,
        default: 'yyyy-MM-dd'
      },
      startPlaceholder: {
        type: String,
        default: '开始日期'
      },
      wh180: {
        type: Boolean,
        default: false
      },
      value: {
        type: String,
        default: ''
      },
      endPlaceholder: {
        type: String,
        default: '结束日期'
      },
      placeholder: {
        type: String,
        default() {
          return this.$t('placeholder.choose')
        }
      }
    },
    computed: {
      value5: {
        get() {
          return this.value;
        },
        set(val) {
          this.$emit('input', val);
        }
      }
    },
    methods: {
      timeChange(val) {
        this.$emit('input', val);
      }
    }
  };
</script>

<style lang="scss" scoped>
  .block {
    display: inline-block;
    /deep/ .el-input__icon.el-icon-date {
      line-height: 30px;
    }
  }
  .block /deep/ .el-input__inner {
    // background-color: $bgcGray;
    padding: 0 15px 0 5px;
    padding-left: 30px !important;
    color: #333;
  }
  .isFocus /deep/ .el-input__inner {
    border-color: #fff;
  }
  .block /deep/ .el-input__prefix {
    font-size: 18px;
    // right: 5px;
    // left: initial;
  }
  // .block /deep/ .el-date-editor.el-input {
  //   min-width: 220px;
  // }
  .wh180 /deep/ .el-date-editor.el-input {
    // width: 100%;
    width: 175px !important;
  }
</style>
